﻿<script type="text/javascript">

    function initcombo() {  //初始化调用方法
        // 分中心
        EUIcombobox("#txtCenterCode", {
            url: '@Url.Content("~/Medical/GetCenter/")',
            valueField: 'ID',
            textField: 'Name',
            //prompt: '--请选择--',
            //editable: false,
            OneOption: [{
                ID: "",
                Name: "--请选择--"
            }],
            onSelect: function (rec) {
                var urlstation = '@Url.Content("~/Medical/GetStation?code=")' + rec.ID;
                EUIcombobox("#txtStationCode", {
                    url: urlstation,
                    valueField: 'ID',
                    textField: 'Name',

                    editable: false,
                    OneOption: [{
                        ID: "",
                        Name: "--请选择--"
                    }]
                });
            }
        });

        //出车分站
        EUIcombobox("#txtStationCode", {
            url: '@Url.Content("~/Medical/GetStation?code=")',
            valueField: 'ID',
            textField: 'Name',

            editable: false,
            OneOption: [{
                ID: "",
                Name: "--请选择--"
            }]
        });
        //年检相关联动
        //当年检间隔选项更改时，到期框联动
        $('#txtSelectASDateIntervalCode').combobox({
            valueField: 'ID',
            textField: 'Name',
            method: 'get',
            editable: false,
            panelHeight: 'auto',
            data: [
            {
                ID: '',
                Name: '--请选择--'
            },
            {
                ID: '3',
                Name: '三个月'
            },
            {
                ID: '6',
                Name: '六个月'
            },
            {
                ID: '1',
                Name: '一年'
            },
            {
                ID: '2',
                Name: '两年'
            }
            ],
            onSelect: function (rec) {
                if (rec.ID != '' && $('#txtAnnualSurveyDate').datebox('getValue')) {
                    //间隔选择的是年
                    if (rec.ID == 1 || rec.ID == 2) {
                        var datez = $('#txtAnnualSurveyDate').datebox('getValue');
                        var date = new Date(datez);
                        $('#txtAnnualSurveyExpireDate').datebox('setValue', date.getFullYear() + parseInt(rec.ID) + "-" + (date.getMonth() + 1) + "-" + date.getDate());
                    }
                        //间隔选择的是月份
                    else {
                        var datezB = $('#txtAnnualSurveyDate').datebox('getValue');

                        var date = new Date(datezB);//将string 转换为Date型。
                        //当月份和间隔月份相加大于12的时候，重新赋值，将12月划分为1年时间，
                        if (date.getMonth() + 1 + parseInt(rec.ID) > 12) {
                            var newyear = date.getFullYear() + 1;
                            var newmonth = (date.getMonth() + 1 + parseInt(rec.ID)) - 12;
                            var newdate = date.getDate();
                        }
                        else {
                            var newyear = date.getFullYear();
                            var newmonth = (date.getMonth() + 1 + parseInt(rec.ID));
                            var newdate = date.getDate();
                        }
                        $('#txtAnnualSurveyExpireDate').datebox('setValue', newyear + "-" + newmonth + "-" + newdate);
                    }
                }
                else {
                    $('#txtAnnualSurveyExpireDate').datebox('clear');
                }
            }
        });
        $('#txtAnnualSurveyDate').datebox({  //当验车日期改变时，重新加一下间隔时间，更新到期日期
            onSelect: function (date) {

                if (EditAnnualSurveyDate != null) {

                    var datez = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
                    var startTime = datez.replace(/-/g, "/");

                    var endTime = EditAnnualSurveyDate.replace(/-/g, "/");
                    var date1 = Date.parse(startTime);
                    var date2 = Date.parse(endTime);
                    var day = Math.ceil((date2 - date1) / (24 * 60 * 60 * 1000));
                    var daynew = Math.abs(day);
                    if (daynew < 90) {
                        $.messager.defaults = { ok: "是的，我要新增记录", cancel: "不，只更正验车日期" };
                        $.messager.confirm('系统检测', '您修改的验车日期与上次验车间隔不足3个月，你想新增一条年检记录（年检流水表）吗？', function (r) {
                            if (r) {
                                ifSaveAS = true;  //
                            }
                            else {
                                ifSaveAS = false;
                            }
                        });
                    }
                }
                var select = $('#txtSelectASDateIntervalCode').combobox('getValue');
                if (select != '') {
                    if (select == 1 || select == 2) {
                        $('#txtAnnualSurveyExpireDate').datebox('setValue', (date.getFullYear() + parseInt(select)) + "-" + (date.getMonth() + 1) + "-" + date.getDate());
                    }
                    else {
                        if (date.getMonth() + 1 + parseInt(select.value) > 12) {
                            var newyear = date.getFullYear() + 1;
                            var newmonth = (date.getMonth() + 1 + parseInt(select)) - 12;
                            var newdate = date.getDate();
                        }
                        else {
                            var newyear = date.getFullYear();
                            var newmonth = (date.getMonth() + 1 + parseInt(select));
                            var newdate = date.getDate();
                        }
                        $('#txtAnnualSurveyExpireDate').datebox('setValue', newyear + "-" + newmonth + "-" + newdate);
                    }
                }

            }
        });

        //保险相关联动
        //当保险间隔选项更改时，到期框联动
        $('#txtSelectIDateIntervalCode').combobox({
            valueField: 'ID',
            textField: 'Name',
            method: 'get',
            panelHeight: 'auto',
            editable: false,
            data: [
          {
              ID: '',
              Name: '--请选择--'
          },
          {
              ID: '1',
              Name: '一年'
          },
          {
              ID: '2',
              Name: '两年'
          }
            ],
            onSelect: function (rec) {
                if (rec.ID != '' && $('#txtInsuranceDate').datebox('getValue')) {

                    //间隔选择的是年
                    if (rec.ID == 1 || rec.ID == 2) {
                        var datez = $('#txtInsuranceDate').datebox('getValue');
                        var date = new Date(datez);
                        $('#txtInsuranceExpireDate').datebox('setValue', date.getFullYear() + parseInt(rec.ID) + "-" + (date.getMonth() + 1) + "-" + date.getDate());
                    }
                }
                else {
                    $('#txtInsuranceExpireDate').datebox('clear');
                }
            }
        });
        $('#txtInsuranceDate').datebox({  //当保险日期改变时，重新加一下间隔时间，更新到期日期
            onSelect: function (date) {
                if (EditInsuranceDate != null) {
                    var datez = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
                    var startTime = datez.replace(/-/g, "/");
                    var endTime = EditInsuranceDate.replace(/-/g, "/");
                    var date1 = Date.parse(startTime);
                    var date2 = Date.parse(endTime);
                    var day = Math.ceil((date2 - date1) / (24 * 60 * 60 * 1000));
                    var daynew = Math.abs(day);
                    if (daynew < 270) {
                        $.messager.defaults = { ok: "是的，我要新增记录", cancel: "不，只更正保险日期" };
                        $.messager.confirm('系统检测', '您修改的保险日期与上次参保间隔不足9个月，你想新增一条保险记录（保险流水表）吗？', function (r) {
                            if (r) {
                                ifSaveI = true;  //
                            }
                            else {
                                ifSaveI = false;
                            }
                        });

                    }
                }
                var select = $('#txtSelectIDateIntervalCode').combobox('getValue');
                if (select == 1 || select == 2) {
                    $('#txtInsuranceExpireDate').datebox('setValue', (date.getFullYear() + parseInt(select)) + "-" + (date.getMonth() + 1) + "-" + date.getDate());
                }
            }
        });

        var urlstr = '@Url.Content("~/CM/CarBasicInfo/getDictionarybyTypeID?TypeID=CMAmbBrand")';  //车辆品牌
        $.EUIcombobox("#txtBrand", {
            url: urlstr,
            valueField: 'ID',
            textField: 'Name',
            editable: false,
            OneOption: [{
                ID: "",
                Name: "--请选择--"
            }]

        });
        var urlstr = '@Url.Content("~/CM/CarBasicInfo/getDictionarybyTypeID?TypeID=CMAmbType")'; //车辆类型
        $.EUIcombobox("#txtType", {
            url: urlstr,
            valueField: 'ID',
            textField: 'Name',
            editable: false,
            OneOption: [{
                ID: "",
                Name: "--请选择--"
            }]
        });
        var urlstr = '@Url.Content("~/CM/CarBasicInfo/getDictionarybyTypeID?TypeID=CMAmbUseFor")';   //使用性质
        $.EUIcombobox("#txtUseFor", {
            url: urlstr,
            valueField: 'ID',
            textField: 'Name',
            editable: false,
            OneOption: [{
                ID: "",
                Name: "--请选择--"
            }]
        });
        var urlstr = '@Url.Content("~/CM/CarBasicInfo/getDictionarybyTypeID?TypeID=CMAmbColor")';  //车身颜色
        $.EUIcombobox("#txtSelectColorCode", {
            url: urlstr,
            valueField: 'ID',
            textField: 'Name',
            editable: false,
            OneOption: [{
                ID: "",
                Name: "--请选择--"
            }]
        });
        var urlstr = '@Url.Content("~/CM/CarBasicInfo/getDictionarybyTypeID?TypeID=CMAmbDriveType")';  //驱动
        $.EUIcombobox("#txtDriveType", {
            url: urlstr,
            valueField: 'ID',
            textField: 'Name',
            editable: false,
            OneOption: [{
                ID: "",
                Name: "--请选择--"
            }]
        });

        $('#txtSelectSteeringPositionCode').combobox({  //转向位置
            valueField: 'ID',
            textField: 'Name',
            method: 'get',
            panelHeight: 'auto',
            editable: false,
            data: [
          {
              ID: '',
              Name: '--请选择--'
          },
          {
              ID: '左',
              Name: '左'
          },
          {
              ID: '右',
              Name: '右'
          }
            ]
        });

        $('#txtDistanceType').combobox({  //路程计算方式
            valueField: 'ID',
            textField: 'Name',
            method: 'get',
            panelHeight: 'auto',
            editable: false,
            data: [
        
          {
              ID: '公里',
              Name: '公里'
          },
          {
              ID: '英里',
              Name: '英里'
          }
            ]
        });

      

        switchtabs();//切换tabs触发的方法，下挂各个其他的链接url

        $('#baofeititle').hide();//报废抬头隐藏
        $('#txtisRejected').val('false');

    }//初始化结束

    //嵌入式页面Iframe
    function newIframe(url, i) {
        var ifid = "'Numid" + i + "'";  //给iframe一个ID ，这个就是唯一，不会出现不知道将iframe下 嵌于哪一个tabs的下面的情况了 。
        var ifrStr = "<iframe id=" + ifid + "  src='" + url + "' style='width:99.5%;height:450px;border:0px solid #000;scrolling:no; '></iframe>";
        return ifrStr;
    }

    function switchtabs() {
        $('#alltbs').tabs({
            onSelect: function (title, index) {  //当更改选项时，获取选择面板更新子内容加载
                var selecttab = $('#alltbs').tabs('getSelected');  // 获取选择的面板
                var selectindex = $('#alltbs').tabs('getTabIndex', selecttab);
                var i = selectindex;


                var txtCenterCode = $('#txtCenterCode').combobox('getValue');
                var txtStationCode = $('#txtStationCode').combobox('getValue');
                var txtPlateNumber = $('#txtPlateNumber').textbox('getValue');
                var txtCarNumber = $('#txtCarNumber').textbox('getValue');


                switch (i) {
                    case 1:
                        //违章
                        var url = '@Url.Content("~/CM/Violation/ViolationList/?PassCenterCode=")' + txtCenterCode + '&PassStationCode=' + txtStationCode + '&PassPlateNumber=' + txtPlateNumber + '&PassCarNumber='+txtCarNumber;
                        $('#alltbs').tabs('update', {
                            tab: selecttab,
                            options: {
                                content: newIframe(url, i)  // 新内容的URL
                            }
                        });
                        break;
                    case 2:
                        //事故
                        var url = '@Url.Content("~/CM/AccidentManage/AccidentManageList/?PassCenterCode=")' + txtCenterCode + '&PassStationCode=' + txtStationCode + '&PassPlateNumber=' + txtPlateNumber + '&PassCarNumber='+txtCarNumber;
                        $('#alltbs').tabs('update', {
                            tab: selecttab,
                            options: {
                                content: newIframe(url, i)  // 新内容的URL
                            }
                        });
                        break;
                    case 3:
                        //加油
                        var url = '@Url.Content("~/CM/Refuel/RefuelList/?PassCenterCode=")' + txtCenterCode + '&PassStationCode=' + txtStationCode + '&PassPlateNumber=' + txtPlateNumber + '&PassCarNumber='+txtCarNumber;
                        $('#alltbs').tabs('update', {
                            tab: selecttab,
                            options: {
                                content: newIframe(url, i)  // 新内容的URL
                            }
                        });
                        break;
                    case 4:
                        //维修
                        var url = '@Url.Content("~/CM/RepairMaintain/RepairMaintainList/?PassCenterCode=")' + txtCenterCode + '&PassStationCode=' + txtStationCode + '&PassPlateNumber=' + txtPlateNumber + '&PassCarNumber='+txtCarNumber;
                        $('#alltbs').tabs('update', {
                            tab: selecttab,
                            options: {
                                content: newIframe(url, i)  // 新内容的URL
                            }
                        });
                        break;
                    default:
                        break;
                }
            }
        });
    }

    function getEditAmb(EditambCode) {  //修改，获取修改内容。根据选择的ambID 去取相关内容，赋值到页面控件上。
        $.ajax({
            type: 'POST',
            url: '@Url.Content("~/CM/CarBasicInfo/getEditAmb")',
            data:
                {
                    ambulanceCode: EditambCode
                },
            dataType: "json",
            success: function (jsData) {
                $('#txtCenterCode').combobox('setValue', jsData.Info.CenterCode);
                $('#txtStationCode').combobox('setValue', jsData.Info.StationCode);

                $('#txtPlateNumber').textbox('setValue', jsData.Info.PlateNumber);

                $('#txtCarNumber').textbox('setValue', jsData.Info.CarNumber);
                $('#txtBrand').combobox('setValue', jsData.Info.Brand);
                $('#txtModel').textbox('setValue', jsData.Info.Model);
                $('#txtType').combobox('setValue', jsData.Info.Type);
                $('#txtUseFor').combobox('setValue', jsData.Info.UseFor);

                if (jsData.Info.EnableDate != null) {

                    var zEnableDate = $.formatDate(jsData.Info.EnableDate);
                    $('#txtEnableDate').datebox('setValue', zEnableDate);// 需要将日期转换下，不转不认识啊！
                }

                $('#txtFrameNumber').textbox('setValue', jsData.Info.FrameNumber);
                $('#txtEngineNumber').textbox('setValue', jsData.Info.EngineNumber);
                $('#txtPrice').numberbox('setValue', jsData.Info.Price);

                if (jsData.Info.AnnualSurveyDate != null) {

                    var zAnnualSurveyDate = $.formatDate(jsData.Info.AnnualSurveyDate);
                    EditAnnualSurveyDate = zAnnualSurveyDate;//同时赋值给全局变量，用于
                    $('#txtAnnualSurveyDate').datebox('setValue', zAnnualSurveyDate);//年检
                }
                $('#txtSelectASDateIntervalCode').combobox('setValue', jsData.Info.SelectASDateIntervalCode);

                if (jsData.Info.AnnualSurveyExpireDate != null) {
                    var zAnnualSurveyExpireDate = $.formatDate(jsData.Info.AnnualSurveyExpireDate);
                    $('#txtAnnualSurveyExpireDate').datebox('setValue', zAnnualSurveyExpireDate);//
                }
                $('#txtAnnualSurveyMoney').textbox('setValue', jsData.Info.AnnualSurveyMoney);//
                if (jsData.Info.InsuranceDate != null) {
                    var zInsuranceDate = $.formatDate(jsData.Info.InsuranceDate);//保险
                    $('#txtInsuranceDate').datebox('setValue', zInsuranceDate);
                }
                EditInsuranceDate = zInsuranceDate;                                     //同时赋值给全局变量，用于
                $('#txtSelectIDateIntervalCode').combobox('setValue', jsData.Info.SelectIDateIntervalCode);//
                if (jsData.Info.InsuranceExpireDate != null) {
                    var zInsuranceExpireDate = $.formatDate(jsData.Info.InsuranceExpireDate);
                    $('#txtInsuranceExpireDate').datebox('setValue', zInsuranceExpireDate);//
                }
                $('#txtInsuranceNumber').textbox('setValue', jsData.Info.InsuranceNumber);//
                $('#txtInsuranceMoney').textbox('setValue', jsData.Info.InsuranceMoney);//

                //车体
                $('#txtSelectColorCode').combobox('setValue', jsData.Info.SelectColorCode);//
                $('#txtLong').textbox('setValue', jsData.Info.Long);//
                $('#txtWidth').textbox('setValue', jsData.Info.Width);//
                $('#txtHeight').textbox('setValue', jsData.Info.Height);//
                $('#txtWheelbase').textbox('setValue', jsData.Info.Wheelbase);//
                $('#txtDriveType').combobox('setValue', jsData.Info.DriveType);//
                $('#txtFrontTread').textbox('setValue', jsData.Info.FrontTread);//
                $('#txtBackTread').textbox('setValue', jsData.Info.BackTread);//
                $('#txtSelectTireSizeCode').textbox('setValue', jsData.Info.SelectTireSizeCode);//
                $('#txtDisplacement').textbox('setValue', jsData.Info.Displacement);//
                $('#txtPower').textbox('setValue', jsData.Info.Power);//
                $('#txtSelectSteeringPositionCode').combobox('setValue', jsData.Info.SelectSteeringPositionCode);//
                $('#txtTotalKG').textbox('setValue', jsData.Info.TotalKG);//

                $('#txtFuel').textbox('setValue', jsData.Info.Fuel);//
                $('#txtApprovedPassenger').textbox('setValue', jsData.Info.ApprovedPassenger);
                $('#txtRemark').textbox('setValue', jsData.Info.Remark);
                //2016-3-1 新增
                $('#txtDistanceType').combobox('setValue', jsData.Info.DistanceType);
                $('#txtTankVolume').numberbox('setValue', jsData.Info.TankVolume);
                $('#txtMaintainDate').datebox('setValue', $.formatDate(jsData.Info.MaintainDate));
                $('#txtMaintainKM').textbox('setValue', jsData.Info.MaintainKM);
                $('#txtNextMaintainKM').textbox('setValue', jsData.Info.NextMaintainKM);


                var boolreject = jsData.Info.isRejected;
                if (boolreject) {
                    $('#baofeititle').show();
                    $.GID("baofei").style.display = "none";
                    $.GID("qxbaofei").style.display = "block";

                }
                else {
                    $('#baofeititle').hide();
                    $.GID("baofei").style.display = "block";
                    $.GID("qxbaofei").style.display = "none";
                }

            }
        })
    }

    function submitAddForm() { //提交新增方法
        $('#formSubmit').form('submit', {
            url: '@Url.Content("~/CM/CarBasicInfo/SaveCarBasicInfo")',
            onSubmit: function () {
                return $(this).form('validate');
            },
            success: function (data) {
                var jsData = $.parseJSON(data);
                //$.handleJsonResult(jsData);
                $.showMsg(jsData.Message, "系统提示", function () { });
                $('#NewCarDetailDialog').dialog('close');

                $('#gridCarBasicList').datagrid('reload');
                //ClearForm();
            }
        });
    }

    function submitEditForm() { //修改页面提交保存
        $('#formSubmit').form('submit', {
            url: '@Url.Content("~/CM/CarBasicInfo/EditAmb")',
            queryParams: {
                zz: EditambCode,
                IFSaveAS: ifSaveAS,
                IFSaveI: ifSaveI
            },//提交的ID
            onSubmit: function () {
                return $(this).form('validate');
            },
            success: function (data) {
                var jsData = $.parseJSON(data);
                //$.handleJsonResult(jsData);
                $.messager.defaults = { ok: "确定", cancel: "取消" };
                $.showMsg(jsData.Message, "系统提示", function () { });
                $('#NewCarDetailDialog').dialog('close');

                $('#gridCarBasicList').datagrid('reload');
               // ClearForm();
            }
        });
    }

    //报废的ajax提交
    function CarIFReject(boolRJ) {
        var zEditambCode = EditambCode;
        var str;
        if (boolRJ)
            str = "确定要“<span style='color:red'>报废该车</span>”吗？";
        else
            str = "确定要“<span style='color:darkgreen'>取消报废</span>”吗？";

        $.messager.confirm('提示', str, function (r) {
            if (r) {
                if (boolRJ) { $('#baofeititle').show(); }
                if (!boolRJ) { $('#baofeititle').hide(); }

                $.ajax({
                    type: 'POST',
                    url: '@Url.Content("~/CM/CarBasicInfo/CarIFReject")',
                    data:
                        {
                            AmbulanceCode: zEditambCode,
                            ifReject: boolRJ
                        },
                    dataType: "json",
                    success: function (jsData) {
                        $.handleJsonResult(jsData, function () {
                            $('#NewCarDetailDialog').dialog('close');
                            ifDobuleMessage = true; //二次显示为true时，不再弹出message。
                            $('#gridCarBasicList').datagrid('reload');
                            ClearForm();
                        });
                    }
                });
            }
        });
    }



    function ClearForm() {  //清除form

        EditAnnualSurveyDate = null;
        EditInsuranceDate = null;

        $('#txtCenterCode').combobox('clear');
        $('#txtStationCode').combobox('clear');

        $('#txtPlateNumber').textbox('clear');

        $('#txtCarNumber').textbox('clear');
        $('#txtBrand').combobox('clear');
        $('#txtModel').textbox('clear');
        $('#txtType').combobox('clear');
        $('#txtUseFor').combobox('clear');
        $('#txtEnableDate').datebox('clear');
        $('#txtFrameNumber').textbox('clear');
        $('#txtEngineNumber').textbox('clear');
        $('#txtPrice').numberbox('clear');

        $('#txtAnnualSurveyDate').datebox('clear');
        $('#txtSelectASDateIntervalCode').combobox('clear');
        $('#txtAnnualSurveyExpireDate').datebox('clear');
        $('#txtAnnualSurveyMoney').textbox('clear');

        $('#txtInsuranceDate').datebox('clear');
        $('#txtSelectIDateIntervalCode').combobox('clear');
        $('#txtInsuranceExpireDate').datebox('clear');
        $('#txtInsuranceNumber').textbox('clear');
        $('#txtInsuranceMoney').textbox('clear');

        //车体
        $('#txtSelectColorCode').combobox('clear');
        $('#txtLong').textbox('clear');
        $('#txtWidth').textbox('clear');
        $('#txtHeight').textbox('clear');
        $('#txtWheelbase').textbox('clear');
        $('#txtDriveType').combobox('clear');
        $('#txtFrontTread').textbox('clear');
        $('#txtBackTread').textbox('clear');
        $('#txtSelectTireSizeCode').textbox('clear');
        $('#txtDisplacement').textbox('clear');
        $('#txtPower').textbox('clear');
        $('#txtSelectSteeringPositionCode').combobox('clear');
        $('#txtTotalKG').textbox('clear');

        $('#txtFuel').textbox('clear');
        $('#txtApprovedPassenger').textbox('clear');
        $('#txtRemark').textbox('clear');
        $('#txtDistanceType').combobox('clear');
        $('#txtTankVolume').numberbox('clear');

    }


    //增加其他tabs，只有查看的时候才会出现
    function ShowOtherTabs() {
        $('#alltbs').tabs('select', 0);
        tab_option1 = $('#alltbs').tabs('getTab', "违章记录").panel('options').tab;
        tab_option1.show();
        tab_option2 = $('#alltbs').tabs('getTab', "事故记录").panel('options').tab;
        tab_option2.show();
        tab_option3 = $('#alltbs').tabs('getTab', "加油记录").panel('options').tab;
        tab_option3.show();
        tab_option4 = $('#alltbs').tabs('getTab', "整修保养记录").panel('options').tab;
        tab_option4.show();

    }
    function HideOtherTabs() {
        $('#alltbs').tabs('select', 0);
        tab_option1 = $('#alltbs').tabs('getTab', "违章记录").panel('options').tab;
        tab_option1.hide();
        tab_option2 = $('#alltbs').tabs('getTab', "事故记录").panel('options').tab;
        tab_option2.hide();
        tab_option3 = $('#alltbs').tabs('getTab', "加油记录").panel('options').tab;
        tab_option3.hide();
        tab_option4 = $('#alltbs').tabs('getTab', "整修保养记录").panel('options').tab;
        tab_option4.hide();
    }


</script>

<div id="NewCarDetailDialog" class="easyui-dialog" title="车辆基本信息明细" data-options="modal:true,collapsible:false,minimizable:false,maximizable:false,closed:true,resizable:false,iconCls:'icon-custom-cWuZiWeiHu'" style="width:1050px;height:auto;padding:10px;">
    <form id="formSubmit" method="post">
        <input name="AmbulanceCode" id="txtAmbulanceCode" type="hidden">
        <input name="isActive" id="txtisActive" type="hidden">
        <input name="isRejected" id="txtisRejected" type="hidden">
        <input name="backup1" id="txtbackup1" type="hidden">
        <input name="backup2" id="txtbackup2" type="hidden">
        <div id="alltbs" class="=easyui-tabs" data-options="border:false">
            <div title="基础信息" data-options="iconCls:'icon-redo',closable:false" style="padding:5px;">
                <table border="0">
                    <tr>
                        <td style="color:#0099FF;" colspan="3">基础信息</td>
                        <td style="color:red; font-size:large" id="baofeititle" colspan="5"> 【已报废！】</td>
                    </tr>
                    <tr>
                        <td style="width:100px" align="right">
                            分中心：
                        </td>
                        <td style="width: 155px">
                            <input class="easyui-combobox" style="width: 140px" name="CenterCode" id="txtCenterCode" data-options="required:true" />

                        </td>
                        <td style="width: 100px" align="right">
                            分站：
                        </td>
                        <td style="width: 155px">
                            <input name="StationCode" id="txtStationCode" class="easyui-combobox" style="width:140px" data-options="required:true" />

                        </td>
                        <td style="width: 100px" align="right">
                            牌照号码：
                        </td>
                        <td style="width: 155px">
                            <input class="easyui-textbox" style="width: 140px" name="PlateNumber" id="txtPlateNumber" data-options="required:true" />
                        </td>
                        <td style="width: 100px" align="right">
                            车辆编号：
                        </td>
                        <td style="width: 155px">
                            <input name="CarNumber" id="txtCarNumber" class="easyui-textbox" style="width:140px" />
                        </td>
                    </tr>
                    <tr>
                        <td  align="right">
                            车辆品牌：
                        </td>
                        <td >
                            <input class="easyui-combobox" style="width: 140px" name="Brand" id="txtBrand" />
                        </td>
                        <td  align="right">
                            车辆型号：
                        </td>
                        <td >
                            <input class="easyui-textbox" style="width: 140px" name="Model" id="txtModel" />
                        </td>
                        <td  align="right">
                            车辆类型：
                        </td>
                        <td >
                            <input class="easyui-combobox" style="width: 140px" name="Type" id="txtType" data-options="panelHeight:'auto'">


                        </td>
                        <td  align="right">
                            使用性质：
                        </td>
                        <td >
                            <input class="easyui-combobox" style="width: 140px" name="UseFor" id="txtUseFor" data-options="panelHeight:'auto'">
                        </td>

                    </tr>
                    <tr>
                        <td  align="right">
                            启用日期：
                        </td>
                        <td>
                            <input class="easyui-datebox" style="width: 140px" name="EnableDate" id="txtEnableDate" data-options="required:true" />

                        </td>
                        <td  align="right">
                            车架号码：
                        </td>
                        <td>
                            <input class="easyui-textbox" style="width: 140px" name="FrameNumber" id="txtFrameNumber" data-options="required:true" />
                        </td>
                        <td  align="right">
                            发动机号：
                        </td>
                        <td>
                            <input class="easyui-textbox" style="width: 140px" name="EngineNumber" id="txtEngineNumber" data-options="required:true" />

                        </td>
                        <td  align="right">
                            设备价格：
                        </td>
                        <td>
                            <input class="easyui-numberbox" style="width: 125px" name="Price" id="txtPrice" data-options="precision:2,prefix:'￥'">元
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <div class="easyui-accordion" style="width: 99%; height: auto;">
                                <div title="年检管理 [每次年检后请更改验车日期和验车费用]" data-options="iconCls:'icon-save'" style="overflow:auto;padding:5px;">
                                    <table border="0">
                                        <tr>
                                            <td width="55px">验车日期</td>
                                            <td><input class="easyui-datebox" style="width: 100px" name="AnnualSurveyDate" id="txtAnnualSurveyDate" data-options="required:true"></td>
                                            <td>
                                                <table>
                                                    <tr><td style="color:#0099FF;">间&nbsp;隔</td></tr>
                                                    <tr><td><img src="~/Images/Custom/RightArrow.jpg" style="height:20px;width:30px" /></td></tr>
                                                </table>
                                            </td>
                                            <td>
                                                <input class="easyui-combobox" style="width: 90px" name="SelectASDateIntervalCode" id="txtSelectASDateIntervalCode" data-options="required:true">


                                            </td>
                                            <td>
                                                <table>
                                                    <tr><td style="color:#0099FF;">到&nbsp;期</td></tr>
                                                    <tr><td><img src="~/Images/Custom/RightArrow.jpg" style="height: 20px;width:30px" /></td></tr>
                                                </table>
                                            </td>
                                            <td><input class="easyui-datebox" style="width: 100px" name="AnnualSurveyExpireDate" id="txtAnnualSurveyExpireDate" ></td>

                                        </tr>
                                        <tr>
                                          

                                            <td>验车费用</td>
                                            <td><input class="easyui-textbox" style="width: 100px" name="AnnualSurveyMoney" id="txtAnnualSurveyMoney"> </td>
                                            <td>元</td>
                                            <td></td>
                                            <td></td>
                                            <td></td>

                                        </tr>
                                    </table>

                                </div>
                            </div>
                        </td>
                        <td colspan="4">
                            <div class="easyui-accordion" style="width: 99%; height: auto; ">
                                <div title="保险管理 [投保后，请更改保险日期和保单号及费用]" data-options="iconCls:'icon-save'" style="overflow:auto;padding:7px;">
                                    <table border="0">
                                        <tr>
                                            <td width="55px">保险日期</td>
                                            <td><input class="easyui-datebox" style="width: 100px" name="InsuranceDate" id="txtInsuranceDate" data-options="required:true"></td>
                                            <td>
                                                <table>
                                                    <tr><td style="color:#0099FF;">间&nbsp;隔</td></tr>
                                                    <tr><td><img src="~/Images/Custom/RightArrow.jpg" style="height:20px;width:30px" /></td></tr>
                                                </table>
                                            </td>
                                            <td>
                                                <input class="easyui-combobox" style="width: 90px" name="SelectIDateIntervalCode" id="txtSelectIDateIntervalCode" data-options="required:true">

                                            </td>
                                            <td>
                                                <table>
                                                    <tr><td style="color:#0099FF;">到&nbsp;期</td></tr>
                                                    <tr><td><img src="~/Images/Custom/RightArrow.jpg" style="height: 20px;width:30px" /></td></tr>
                                                </table>
                                            </td>
                                            <td><input class="easyui-datebox" style="width: 100px" name="InsuranceExpireDate" id="txtInsuranceExpireDate" ></td>

                                        </tr>
                                        <tr>
                                            <td>保单号</td>
                                            <td><input class="easyui-textbox" style="width: 100px" name="InsuranceNumber" id="txtInsuranceNumber"></td>

                                            <td width="55px" colspan="2" align="right">保险金额</td>
                                            <td colspan="2"><input class="easyui-textbox" style="width: 100px" name="InsuranceMoney" id="txtInsuranceMoney">元 </td>

                                        </tr>
                                    </table>
                                </div>
                            </div>
                        </td>
                    </tr>

                    <tr><td style="color:#0099FF;">车体</td></tr>
                    <tr>
                        <td  align="right">
                            车身颜色：
                        </td>
                        <td>
                            <input name="SelectColorCode" id="txtSelectColorCode" class="easyui-combobx" style="width:140px;" data-options="panelHeight:'auto'">
                        </td>
                        <td  align="right">
                            长：
                        </td>
                        <td>
                            <input name="Long" id="txtLong" class="easyui-textbox" style="width:140px;">
                        </td>
                        <td  align="right">
                            宽：
                        </td>
                        <td>
                            <input name="Width" id="txtWidth" class="easyui-textbox" style="width:140px;">
                        </td>
                        <td  align="right">
                            高：
                        </td>
                        <td>
                            <input name="Height" id="txtHeight" class="easyui-textbox" style="width:140px;">
                        </td>

                    </tr>
                    <tr>

                        <td  align="right">
                            轴距：
                        </td>
                        <td>
                            <input name="Wheelbase" id="txtWheelbase" class="easyui-textbox" style="width:140px;">
                        </td>
                        <td  align="right">
                            驱动：
                        </td>
                        <td>
                            <input name="DriveType" id="txtDriveType" class="easyui-combobox" style="width:140px;" data-options="panelHeight:'auto'">


                        </td>

                        <td  align="right">
                            轮距/前：
                        </td>
                        <td>
                            <input name="FrontTread" id="txtFrontTread" class="easyui-textbox" style="width:140px;">
                        </td>

                        <td  align="right">
                            轮距/后：
                        </td>
                        <td>
                            <input name="BackTread" id="txtBackTread" class="easyui-textbox" style="width:140px;">
                        </td>
                    </tr>
                    <tr>
                        <td  align="right">
                            轮胎规格：
                        </td>
                        <td>
                            <input name="SelectTireSizeCode" id="txtSelectTireSizeCode" class="easyui-textbox" style="width:140px;">
                        </td>
                        <td align="right">
                            排量：
                        </td>
                        <td>
                            <input name="Displacement" id="txtDisplacement" class="easyui-textbox" style="width:140px;">
                        </td>

                        <td align="right">
                            功率：
                        </td>
                        <td>
                            <input name="Power" id="txtPower" class="easyui-textbox" style="width:140px;">
                        </td>
                        <td  align="right">
                            转向位置：
                        </td>
                        <td>
                            <input name="SelectSteeringPositionCode" id="txtSelectSteeringPositionCode" class="easyui-combobox" style="width:140px;" data-options="panelHeight:'auto'">

                        </td>
                    </tr>
                    <tr>
                        <td  align="right">
                            总质量：
                        </td>
                        <td>
                            <input name="TotalKG" id="txtTotalKG" class="easyui-textbox" style="width:140px;">
                        </td>

                        <td align="right">
                            燃料：
                        </td>
                        <td>
                            <input name="Fuel" id="txtFuel" class="easyui-textbox" style="width:140px;">
                        </td>
                        <td  align="right">
                            核定载客：
                        </td>
                        <td >
                            <input name="ApprovedPassenger" id="txtApprovedPassenger" class="easyui-textbox" style="width:140px;">
                        </td>
                        <td align="right">
                            油箱容积：
                        </td>
                        <td colspan="2">
                            <input name="TankVolume" id="txtTankVolume" class="easyui-numberbox" style="width: 125px;"> 升
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            本次保养日期：
                        </td>
                        <td>
                            <input name="MaintainDate" id="txtMaintainDate" class="easyui-datebox" style="width:140px;">
                        </td>
                        <td align="right">
                            本次保养公里数：
                        </td>
                        <td>
                            <input name="MaintainKM" id="txtMaintainKM" class="easyui-textbox" style="width:140px;">
                        </td>
                        <td align="right">
                            下次保养公里数：
                        </td>
                        <td>
                            <input name="NextMaintainKM" id="txtNextMaintainKM" class="easyui-textbox" style="width:140px;">
                        </td>
                    </tr>
                    <tr>
                        <td align="right">备注：</td>
                        <td colspan="3">
                            <input name="Remark" id="txtRemark" class="easyui-textbox" data-options="multiline:true" style="width:98%;height:40px">
                        </td>
                        <td align="right">路程方式：</td>
                        <td >
                            <input name="DistanceType" id="txtDistanceType" class="easyui-combobox" style="width:140px;">
                        </td>
                        <td align="right"> </td>
                        <td>
                            <a href="javascript:void(0)" id="baofei" style="color: red; width: 90px" class="easyui-linkbutton" onclick="CarIFReject(true);">报废该车</a>
                            <a href="javascript:void(0)" id="qxbaofei" style="color: #0099FF; width: 90px" class="easyui-linkbutton" onclick="CarIFReject(false);">取消报废</a>
                        </td>
                    </tr>
                    <tr>

                        <td colspan="8" align="center">
                            <a href="javascript:void(0)" style="width: 90px; font-size:large" id="btnedit" class="easyui-linkbutton" data-options="iconCls:'icon-edit'" onclick="submitEditForm();">确定修改</a>
                            <a href="javascript:void(0)" style="width:90px;font-size:large" id="btnadd" class="easyui-linkbutton" data-options="iconCls:'icon-add'" onclick="submitAddForm();">确定新增</a>
                        </td>

                    </tr>
                </table>
            </div>
            <div title="违章记录" id="weizhangtab" data-options="iconCls:'icon-redo',closable:false" style="padding:5px;">
            </div>
            <div title="事故记录" id="shigutab" data-options="iconCls:'icon-redo',closable:false" style="padding: 5px;">
            </div>
            <div title="加油记录" id="jiayoutab" data-options="iconCls:'icon-redo',closable:false" style="padding:5px;">
            </div>
            <div title="整修保养记录" id="weixiutab" data-options="iconCls:'icon-redo',closable:false" style="padding:5px;">
            </div>
        </div>
    </form>
</div>

